package com.ljx.itbbs.server.mall.service.impl;

import com.ljx.itbbs.server.mall.dao.CouponRecordDao;
import com.ljx.itbbs.server.mall.domain.entity.CouponRecordEntity;
import com.ljx.itbbs.server.mall.service.CouponRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class CouponRecordServiceImpl implements CouponRecordService {

    @Autowired
    private CouponRecordDao couponRecordDao;

    @Override
    public void useCoupon(Long couponId, Long userId) {
        couponRecordDao.useCoupon(couponId, userId);
    }

    @Override
    public CouponRecordEntity getCouponRecord(Long userId, Long couponId) {
        return couponRecordDao.getCouponRecord(userId, couponId);
    }

    @Override
    public void saveCouponRecord(CouponRecordEntity couponRecordEntity) {
        couponRecordDao.save(couponRecordEntity);
    }
}
